package utils

import (
	"reflect"
	"time"
)

func IsSlice(v interface{}) bool {
	kind := reflect.TypeOf(v).Elem().Kind()
	return kind == reflect.Slice
}


func IsArray(v interface{}) bool {
	kind := reflect.TypeOf(v).Elem().Kind()
	return kind == reflect.Array
}



func IsStruct(v interface{}) bool {
	kind := reflect.TypeOf(v).Elem().Kind()
	return kind == reflect.Struct
}


// 是否适合数据列
func AdaptColumn(v interface{}) bool{
	kind := reflect.TypeOf(v).Elem().Kind()
	switch kind {
		case reflect.String:
		case reflect.Bool:
		case reflect.Int:
		case reflect.Int8:
		case reflect.Int16:
		case reflect.Int32:
		case reflect.Int64:
		case reflect.Uint:
		case reflect.Uint8:
		case reflect.Uint16:
		case reflect.Uint32:
		case reflect.Uint64:
		case reflect.Float32:
		case reflect.Float64: return true

	}

	if _,ok := v.(time.Time); ok {
		return true
	}



	return false
}
